//
//  THAlertView.h
//  MengLiao
//
//  Created by xiuxin on 2022/7/15.
//  Copyright © 2022 BaseBusiness. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "THImageAlertContentView.h"

typedef NS_ENUM(NSUInteger, THAlertViewStyle) {
    THAlertViewStyleAlert       = 0,
    THAlertViewStyleActionSheet = 1  //暂未开发
};

@class THAlertView;

typedef void (^ _Nullable THAlertViewHandler)(THAlertView * _Nonnull alertView);
//typedef void (^ _Nullable THAlertViewActionHandler)(THAlertView * _Nonnull alertView, NSUInteger index, NSString * _Nullable title);

/*
暂时不支持delegate,其他样式后期扩展,暂时不需要动画关闭
*/

@interface THAlertView : NSObject
/// 点击空白是否可以关闭 (默认不可关闭)
@property (nonatomic, assign) BOOL isBgCanClose;

///是否是一行1个的竖排按钮
@property (nonatomic, assign) BOOL btnVerticalDirection;

/// 是否勾选不再提醒(只读)
@property (nonatomic, assign, readonly)BOOL isSelect;

@property (nonatomic, assign) CGFloat backgroundAlpha;

@property (nonatomic, strong, readonly)THImageAlertContentView *imgContentView;


- (void)show;

- (void)dimiss;

- (nonnull instancetype)initWithTitle:(nullable NSString *)title
                                 desc:(nullable NSString *)desc
                         sureBtnTitle:(nullable NSString *)sureBtnTitle
                        actionHandler:(THAlertViewHandler)actionHandler;

- (nonnull instancetype)initWithTitle:(nullable NSString *)title
                             descAttr:(nullable NSAttributedString *)desc
                         sureBtnTitle:(nullable NSString *)sureBtnTitle
                        actionHandler:(THAlertViewHandler)actionHandler;

- (nonnull instancetype)initWithTitle:(nullable NSString *)title
                                    desc:(nullable NSString *)desc
                            sureBtnTitle:(nullable NSString *)sureBtnTitle
                          cancelBtnTitle:(nullable NSString *)cancelBtnTitle
                           actionHandler:(THAlertViewHandler)actionHandler
                           cancelHandler:(THAlertViewHandler)cancelHandler;

- (nonnull instancetype)initWithTitle:(nullable NSString *)title
                                    desc:(nullable NSString *)desc
                            sureBtnTitle:(nullable NSString *)sureBtnTitle
                          cancelBtnTitle:(nullable NSString *)cancelBtnTitle
                             selectTitle:(nullable NSString *)selectTitle
                           actionHandler:(THAlertViewHandler)actionHandler
                           cancelHandler:(THAlertViewHandler)cancelHandler;

#pragma mark - 图片自定义样式

- (nonnull instancetype)initImgTypeWithImgStr:(nullable NSString *)imgStr
                                        title:(nullable NSString *)title
                                         desc:(nullable NSString *)desc
                                      attrStr:(nullable NSAttributedString *)attrStr
                               cancelBtnTitle:(nullable NSString *)cancelBtnTitle
                                 sureBtnTitle:(nullable NSString *)sureBtnTitle
                                actionHandler:(THAlertViewHandler)actionHandler
                                cancelHandler:(THAlertViewHandler)cancelHandler;


#pragma mark - 图片自定义样式

- (nonnull instancetype)initJLImgTypeWithImgStr:(nullable NSString *)imgStr
                                        title:(nullable NSString *)title
                                         desc:(nullable NSString *)desc
                                      attrStr:(nullable NSAttributedString *)attrStr
                               cancelBtnTitle:(nullable NSString *)cancelBtnTitle
                                 sureBtnTitle:(nullable NSString *)sureBtnTitle
                                actionHandler:(THAlertViewHandler)actionHandler
                                cancelHandler:(THAlertViewHandler)cancelHandler;

#pragma mark - 透明样式
- (nonnull instancetype)initDarkStyleTitle:(nullable NSString *)title
                                      desc:(nullable NSString *)desc;


#pragma mark - 竖排按钮弹窗
- (nonnull instancetype)initWithTitle:(nullable NSString *)title
                                 desc:(nullable NSString *)desc
                 verticleSureBtnTitle:(nullable NSString *)sureBtnTitle
               verticleCancelBtnTitle:(nullable NSString *)cancelBtnTitle
                        actionHandler:(THAlertViewHandler)actionHandler
                        cancelHandler:(THAlertViewHandler)cancelHandler;
@end
